<!-- This page contains text boxes and Title,Topic,Content,Key related words
, And Experience level of the tutorial inserted in the boxes in order to perform the edit 
  @author Haidy Essam-->
#{extends 'main.html' /}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<p>Edit Tutorial</p>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit Tutorial</title>

<script type="text/javascript">
	tinyMCE
			.init({
				mode : "textareas",
				theme : "advanced",
				plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

				theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,cleanup,help,code,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "center",
				theme_advanced_resizing : true,
				skin : "o2k7"
			});
</script>

</head>
<body>
	<form action="@{Tutorials.updateChanges()}" method="POST">
		<input name="tutorialId" style="display: none;" value="${tutorial.id}"></input>
		Title : <span style="color: #c00" class="error">#{error 'title'
			/}</span><br> <input name="title" COLS=20 ROWS=3
			value="${version.Title}"></input> <br> Content *: <span
			style="color: #c00" class="error">#{error 'content' /}</span><br>
		<textarea COLS=150 ROWS=40 name="content" COLS=40 ROWS=6>${version.content}</textarea>
		<br> Key related Words with "," between words And No Spaces: <span
			style="color: #c00" class="error">#{error 'words' /}</span><br>
		<input name="words" COLS=30 ROWS=2 value="${version.Stringofwords}"></input>
		<br> Experience level *:<br> <select name="Exp"
			id="mySelect">
			<option>Select</option>
			<option>Beginner</option>
			<option>Medium</option>
			<option>Expert</option>
			<br />
			<br />
		</select> <input type="submit" value="Done Editing" /> <br /> <br />
	</form>
	<form action="@{Tutorials.allEditVersions(tutorial.id)}" method="post">
		<input type="submit" value="All Editing Versions">
	</form>
	<!-- @Author Nourhan, created two button publish & hide to change the status with pop-up
	      messages when the actions are done -->
	<form action="@{Tutorials.publishTutorial()}" method="post">
		<input style="display: none;" name="tutId" value="${tutorial.id}" />
		<input type="submit" value="Publish" />
	</form>

	<form action="@{Tutorials.hideTutorial()}" method="post">
		<input style="display: none;" name="tutId" value="${tutorial.id}" />
		<input type="submit" value="Hide Tutorial" />
	</form>
	<!-- End Nourhan Elmalahy -->
	<form action="@{Tutorials.tutorialPage()}" method="post">
		<input style="display: none;" name="tutId" value="${tutorial.id}" />
		<input type="submit" value="Back to the Tutorial Page" />
	</form>
</body>
</html>
